import request from '@/utils/request'

// 查询营销活动列表
export function listActivityManage(query) {
  return request({
    url: '/activityManage/activityManage/list',
    method: 'get',
    params: query
  })
}

// 查询浏览记录列表
export function getBrowsingRecords(query) {
  return request({
    url: '/activityManage/activityManage/getBrowsingRecords',
    method: 'get',
    params: query
  })
}

// 查询活动订单列表
export function getActivityOrders(query) {
  return request({
    url: '/activityManage/activityManage/getActivityOrders',
    method: 'get',
    params: query
  })
}

// 查询营销活动详细
export function getActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/' + activityId,
    method: 'get'
  })
}

// 新增营销活动
export function addActivityManage(data) {
  return request({
    url: '/activityManage/activityManage',
    method: 'post',
    data: data
  })
}

// 修改营销活动
export function updateActivityManage(data) {
  return request({
    url: '/activityManage/activityManage',
    method: 'put',
    data: data
  })
}

// 删除营销活动
export function delActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/' + activityId,
    method: 'delete'
  })
}

// 导出营销活动
export function exportActivityManage(query) {
  return request({
    url: '/activityManage/activityManage/export',
    method: 'get',
    params: query
  })
}

// 获取适用单位
export function applicableUnitList(query) {
  return request({
    url: "/activityManage/activityManage/storeBasicList",
    method: "get",
    params: query,
  });
}

// 车型列表
export function carModelListByBiz(query) {
  return request({
    url: '/member/basic/carModelListByBiz',
    method: 'get',
    params: query
  })
}
// 上传图片
export function uploadImg(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data
  })
}
// 查询优惠券列表
export function listCouponManage(query) {
  return request({
    url: '/marketingManagement/couponManage/listBytype',
    method: 'get',
    params: query
  })
}
// 暂停营销活动
export function suspendActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/suspend/' + activityId,
    method: 'put'
  })
}
// 恢复营销活动
export function recoveryActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/recovery/' + activityId,
    method: 'put'
  })
}
// 精准推送
export function pushActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/push/' + activityId,
    method: 'put'
  })
}
// 提前结束
export function overActivityManage(activityId) {
  return request({
    url: '/activityManage/activityManage/over/' + activityId,
    method: 'put'
  })
}
